class HomeModel {
  String id;
  String title;
  int colorInt;

  HomeModel({required this.id, required this.title, required this.colorInt});

  // flutter的json一般说的是map，并不是json字符串
  Map<String, dynamic> toJson() {
    return {"id": id, "title": title, "colorInt": colorInt};
  }

  // flutter的json一般说的是map，并不是json字符串
  static HomeModel fromJson(Map<String, dynamic> json) {
    return HomeModel(
        id: json["id"], title: json["title"], colorInt: json["colorInt"]);
  }
}
